import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class BufferedWriterDemo {
    public static void main(String[] args) throws IOException {
        //添加参数true也可以追加
        Writer fw = new FileWriter("file-io\\src\\data5.txt",true);
        BufferedWriter bw = new BufferedWriter(fw);
        //write方法可以直接写字符,编码,字符串(数组),并且可以限定范围
        bw.write(98);
        bw.newLine();//比普通的字节流多一个换行接口
        bw.write("字符串只要前三个字",0,3);
        bw.close();
    }
}
